<?php
/*
	[gunianwang system]
	NAME:agency_model
	AUTHOR:hl
	DATE:2012-07-02
*/
if (!defined('IN_ELS'))
{
    die('Hacking attempt');
}

class membersbase extends base {
	function membersbase() {
		$this->base();
	}
	//删除会员操作
	function deletemembers($where){
		$retValue = $this->dbDelete("gnw_user",$where);
	}

	//查询会员数量操作
	function getmembersCount($where){
		$sqlText = "select count(*) from gnw_user ";
		$sqlText .= $where;
		$data=$this->db->result_first($sqlText);
		return $data;
	}
	//查询会员列表操作
	function getmembersList($where,$limitText){
		$sqlText  = "select *,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time from gnw_user ";
		$sqlText .= $where;
		$sqlText .= " order by create_time desc ";
		$sqlText .= $limitText;
		$data=$this->db->fetch_all($sqlText);
		return $data;
	}
	//查询会员单条数据操作
	function getmembersContent($user_id){
		$sqlText = "select * from gnw_user where id=".$user_id;
		$data=$this->db->fetch_first($sqlText);
		return $data;
	}

	// 修改会员是否有效，审核状态
	function updatemembers($data,$where)
	{
		$retValue = $this->dbUpdate("gnw_user",$data,$where);
		return $retValue;
	}

	

}


?>